package com.zhanghe.controller;

import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http.FullHttpRequest;

import com.zhanghe.annotation.Controller;
import com.zhanghe.annotation.RequestMapping;

@Controller
public class HelloController {
	
	@RequestMapping("/hello")
	public String hello(FullHttpRequest fullHttpRequest){
		System.out.println("hello world");
		ByteBuf byteBuf = fullHttpRequest.content();
	    byte[] byteArray = new byte[byteBuf.capacity()];
	    byteBuf.readBytes(byteArray);
	    System.out.println(new String(byteArray));
		return "hello";
	}
	
}
